package com.wzh.codegen.biz.domain.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.util.List;

/**
 * 代码生成表DTO
 *
 * @author wzh
 * @since 2024-01-01
 */
@Data
@Schema(description = "代码生成表DTO")
public class CodegenTableDTO {

    @Schema(description = "数据源ID")
    @NotNull(message = "数据源ID不能为空")
    private Long datasourceId;

    @Schema(description = "表名")
    @NotBlank(message = "表名不能为空")
    private String tableName;

    @Schema(description = "表注释")
    private String tableComment;

    @Schema(description = "实体类名")
    @NotBlank(message = "实体类名不能为空")
    private String entityName;

    @Schema(description = "包名")
    @NotBlank(message = "包名不能为空")
    private String packageName;

    @Schema(description = "生成路径")
    @NotBlank(message = "生成路径不能为空")
    private String generatePath;

    @Schema(description = "作者")
    private String author;

    @Schema(description = "表字段列表")
    private List<CodegenColumnDTO> columns;

    @Schema(description = "是否生成Controller")
    private Boolean generateController = true;

    @Schema(description = "是否生成Service")
    private Boolean generateService = true;

    @Schema(description = "是否生成Mapper")
    private Boolean generateMapper = true;

    @Schema(description = "是否生成XML")
    private Boolean generateXml = true;

}
